package com.example.ByteStream;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author Jason
 * @PACKAGE_NAME com.example.ByteStream
 * @Description 复制文件
 * @date 2023-12-11 23:11
 */
public class FileReaderWriterDemo {
    public static void main(String[] args) throws IOException {
        //1.创建流
        FileReader fr = new FileReader("d:\\aaa.txt");
        FileWriter fw = new FileWriter("d:\\eee.txt");

        int data = 0;
        while ((data = fr.read()) != -1) {
            fw.write(data);
        }
        fw.close();
        fr.close();
    }
}
